<?php

require(__META_CONTROLS_GEN__ . '/ProjectMetaControlGen.class.php');

/**
 * This is a MetaControl customizable subclass, providing a QForm or QPanel access to event handlers
 * and QControls to perform the Create, Edit, and Delete functionality of the
 * Project class.  This code-generated class extends from
 * the generated MetaControl class, which contains all the basic elements to help a QPanel or QForm
 * display an HTML form that can manipulate a single Project object.
 *
 * To take advantage of some (or all) of these control objects, you
 * must create a new QForm or QPanel which instantiates a ProjectMetaControl
 * class.
 *
 * This file is intended to be modified.  Subsequent code regenerations will NOT modify
 * or overwrite this file.
 *
 * @package flx_qcubed
 * @subpackage MetaControls
 */
class ProjectMetaControl extends ProjectMetaControlGen {
    // Initialize fields with default values from database definition
    /*
      public function __construct($objParentObject, Project $objProject) {
      parent::__construct($objParentObject,$objProject);
      if ( !$this->blnEditMode ){
      $this->objProject->Initialize();
      }
      }
     */

    /**
     * Create and setup QDateTimePicker calDate
     * @param string $strControlId optional ControlId to use
     * @return QDateTimePicker
     */
    public function calDate_Create($strControlId = null) {
        $this->calDate = new QCalendar($this->objParentObject, $strControlId);
        $this->calDate->Name = QApplication::Translate('Date');
        $this->calDate->DateTime = $this->objProject->Date;
        $this->calDate->Required = true;
        return $this->calDate;
    }

    /**
     * Create and setup QTextBox txtDescription
     * @param string $strControlId optional ControlId to use
     * @return QTextBox
     */
    public function txtDescription_Create($strControlId = null) {
        $objControl = parent::txtDescription_Create($strControlId);
        $objControl->TextMode = QTextMode::MultiLine;
        $objControl->Rows = 8;
        return $objControl;
    }

    /**
     * Create and setup QSelect2ListBox ddlService
     * @param string $strControlId optional ControlId to use
     * @return QSelect2ListBox
     */
    public function ddlService_Create($strControlId = null) {
        //$objControl = new QSelect2ListBox($this->objParentObject, $strControlId);
        $objControl = new QListBox($this->objParentObject, $strControlId);
        $objControl->Name = 'Services';
        $objControl->SelectionMode = QSelectionMode::Multiple;
        //$objControl->AllowClear = true;
        //$objControl->CloseOnSelect = false;
        //$objControl->Placeholder = 'Select Services';
        $objControl->Required = true;
        return $objControl;
    }

}

?>